<script setup lang='ts'>
  import { onMounted, reactive } from 'vue';
  import { statisticsApi } from '@/api/controller';
  import { Toastloading } from '@/utils/public';
  import { getSummaries } from '@/utils'
  const action = reactive({
    list:[] as any[],
  })
  const listQuery = reactive({
    page:1,
    limit:20,
  })
  const handleSerach = ()=>{
    getList()
  }
  const getList = async()=> {
    const loading = Toastloading()
    const res = await statisticsApi.buildAFloorGiftlog()
    loading.close()
    const { data=[] } = res.data
    action.list = data
  }
  onMounted(()=>{
    getList()
  })
</script>

<template>
  <div class="xm-content">
    <div class="xm-headTab">
      <div class="labelBox">
        <div class="labelItem">
          <el-button type="primary" @click="handleSerach">刷新</el-button>
        </div>
      </div>
    </div>
    <el-table
      class="xm-TableCenter"
      show-summary
      :data="action.list"
      border
      :summary-method="((param:any)=>getSummaries(param,[1,2]))"
    >
      <el-table-column width="100" prop="id" align="center" label="id"/>
      <el-table-column min-width="120" prop="gift_id" align="center" label="送出礼物id" />
      <el-table-column min-width="120" prop="giftname" align="center" label="礼物名称" />
      <el-table-column min-width="120" prop="send_num" align="center" label="送出礼物数" />
      <el-table-column min-width="120" prop="send_user_num" align="center" label="用户送出数" />
      <el-table-column min-width="120" prop="damion_value" align="center" label="礼物总计钻石" />
    </el-table>
  </div>
</template>